package com.woniuxy.demo.constant;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author 佘赛飞
 * @create 2021 -10 -10 11:05 AM
 */
//SpringBean的生命周期
@Component
@Data
public class MyImageConstant implements InitializingBean {
    @Value("${myimage.resourceHandlers}")
    private String  resourceHandler;
    public static String RESOURCEHANDLER;

    @Value("${myimage.resourceLocations}")
    private String  resourceLocations;
    public static String RESOURCELOCATIONS;

    @Override
    public void afterPropertiesSet() throws Exception {
        // 这个方法在属性赋值之后执行
        RESOURCEHANDLER=this.resourceHandler;
        RESOURCELOCATIONS=this.resourceLocations;
    }
}
